import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)
const Home = () =>
    import ('@/pages/home')
const findProject = () =>
    import ('@/pages/findProject')
const Pages1 = () =>
    import ('@/pages/pages1/pages1')
const Pages4 = () =>
    import ('@/pages/pages1/pages4')
const suibian = () =>
    import ('@/pages/suibian')
    const ViewOne = () =>
    import ('@/pages/views/viewOne')
    const ViewTwo = () =>
    import ('@/pages/views/viewTwo')
    const error404 = () =>
    import ('@/pages/404/404.vue')
// let codes = 0
// if (codes ===0) {
//     this.path = '/page2'
// };
export default new Router({

    routes: [{
        path: '/',
        
        component: Home,
        // redirect: to => {
        //     // 方法接收 目标路由 作为参数
        //      return '/page2'
        //   },
        children: [
        ]
    },
    {
        path: '/ViewOne',
        name: 'ViewOne',
        component: ViewOne
    },
    {
        path: '/404', // 此处需特别注意至于最底部
        component: error404,
    },
    {
        path: "*",
        redirect: "/404"
      }
]
})
